/*
 * Copyright (C) 2022  即时通讯网(52im.net) & Jack Jiang.
 * The MobileIMSDK v6.1 Project.
 * All rights reserved.
 *
 * > Github地址：https://github.com/JackJiang2011/MobileIMSDK
 * > 文档地址：  http://www.52im.net/forum-89-1.html
 * > 技术社区：  http://www.52im.net/
 * > 技术交流群：320837163 (http://www.52im.net/topic-qqgroup.html)
 * > 作者公众号：“【即时通讯技术圈】”，欢迎关注！
 * > 联系作者：  http://www.52im.net/thread-2792-1-1.html
 *
 * "即时通讯网(52im.net) - 即时通讯开发者社区!" 推荐开源工程。
 *
 * QoS4SendDaemonS2C.java at 2022-7-12 16:35:58, code by Jack Jiang.
 */
package com.nami.dispatcher.domain.qos;


import com.nami.dispatcher.domain.handler.RetryForwardPacketHandler;
import com.nami.dispatcher.domain.handler.SendFailHandler;
import org.dromara.common.core.utils.SpringUtils;

public class QosSendDaemonS2C extends QosSendDaemonRoot {
    private static volatile QosSendDaemonS2C instance = null;

    public static QosSendDaemonS2C getInstance() {
        if (instance == null) {
            synchronized (QosSendDaemonS2C.class) {
                if (instance == null) {
                    instance = new QosSendDaemonS2C();
                    SendFailHandler bean = SpringUtils.getBean(SendFailHandler.class);
                    RetryForwardPacketHandler retryHandler = SpringUtils.getBean(RetryForwardPacketHandler.class);
                    instance.setC2CMsgSendFailService(bean);
                    instance.setRetryHandler(retryHandler);
                    instance.startup(true);
                }
            }
        }
        return instance;
    }

    private QosSendDaemonS2C() {
        super(0, 0, -1, true, "-本机QoS");
    }
}
